package com.jackstraw.jack_base.datasource.mybatis.base.dao;

import com.jackstraw.jack_base.datasource.database.parten.base.dao.BaseDao;
import com.jackstraw.jack_base.datasource.mybatis.base.entity.po.MyBatisPo;
import com.jackstraw.jack_base.datasource.mybatis.base.entity.po.PoExample;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Param;

import java.util.Collection;
import java.util.List;
import java.util.Map;


/**
 * MyBatis数据库持久层
 *
 * @param <PO> 数据库表实体类
 * @param <ID> 主键类
 * @param <PE> PoExample
 */
public interface MyBatisDao<PO extends ID, ID extends MyBatisPo<PO>, PE extends PoExample>
        extends BaseDao<PO> {

    Long countByExample(PE example);

    Integer deleteByExample(PE example);

    Integer deleteByPrimaryKey(ID key);

    Integer deleteBatchByPrimaryKey(@Param("keyS") Collection<ID> keyS);

    Integer insert(PO record);

    Integer insertBatch(@Param("recordS") Collection<PO> recordS);

    Integer insertSelective(PO record);

    List<PO> selectByExample(PE example);

    PO selectByPrimaryKey(ID key);

    List<PO> selectMoreByPrimaryKey(@Param("keyS") Collection<ID> keyS);

    Integer updateByExampleSelective(@Param("record") PO record, @Param("example") PE example);

    Integer updateByExample(@Param("record") PO record, @Param("example") PE example);

    Integer updateByPrimaryKeySelective(PO record);

    Integer updateByPrimaryKey(PO record);
}
